//
//  UIView+FrameChange.h
//  WZB
//
//  Created by WZB on 15-7-13.
//  Copyright (c) 2015年 WZB. All rights reserved.
//  提供快速更改frame的几个属性的方法

#import <UIKit/UIKit.h>

@interface UIView (FrameChange)
@property (nonatomic, assign) CGFloat x;
@property (nonatomic, assign) CGFloat y;
@property (nonatomic, assign) CGFloat width;
@property (nonatomic, assign) CGFloat height;
@property (nonatomic, assign) CGSize size;
@property (nonatomic, assign) CGPoint origin;
@property (nonatomic, assign) CGFloat centerX;
@property (nonatomic, assign) CGFloat centerY;
@property (nonatomic, assign) CGFloat right;
@property (nonatomic, assign) CGFloat bottom;
// 与其他控件的大小关系
// 影响其大小
- (UIView *)widthEqualTo:(UIView *)brotherView;
- (UIView *)heigthEqualTo:(UIView *)brotherView;
- (UIView *)sizeEqualTo:(UIView *)brotherView;
- (UIView *)sizeWith:(CGSize)size;

// 与父控件对齐的关系
// 只影响其坐标位置，不影响其大小
- (UIView *)alignParentTop;
- (UIView *)alignParentBottom;
- (UIView *)alignParentLeft;
- (UIView *)alignParentRight;

- (UIView *)alignParentCenter;
- (UIView *)alignParentCenter:(CGPoint)margin;

- (UIView *)alignParentTopWithMargin:(CGFloat)margin;
- (UIView *)alignParentBottomWithMargin:(CGFloat)margin;
- (UIView *)alignParentLeftWithMargin:(CGFloat)margin;
- (UIView *)alignParentRightWithMargin:(CGFloat)margin;

// 与父控件的边距
// 只影响其坐标位置，影响其大小
- (UIView *)marginParetnTop:(CGFloat)top bottom:(CGFloat)bottom left:(CGFloat)left rigth:(CGFloat)right;
- (UIView *)marginParentWithEdgeInsets:(UIEdgeInsets)inset;
- (UIView *)marginParetn:(CGFloat)margin;
- (UIView *)marginParetnHorizontal:(CGFloat)margin;
- (UIView *)marginParetnVertical:(CGFloat)margin;
- (UIView *)marginParentTop:(CGFloat)margin;
- (UIView *)marginParentBottom:(CGFloat)margin;
- (UIView *)marginParentLeft:(CGFloat)margin;
- (UIView *)marginParentRight:(CGFloat)margin;
- (UIView *)sameWith:(UIView *)brotherView;
- (UIView *)layoutToLeftOf:(UIView *)brotherView margin:(CGFloat)margin;
- (UIView *)layoutToRightOf:(UIView *)brotherView margin:(CGFloat)margin;
- (UIView *)scaleToLeftOf:(UIView *)brotherView margin:(CGFloat)margin;

/** 从xib加载 */
+ (instancetype)viewFromXib;

/** 获取view当前的控制器 */
- (UIViewController *)viewController;

/* 添加高斯模糊 **/
- (UIVisualEffectView *)addBlurEffect;

/* 插入高斯模糊，默认位置为0 **/
- (UIVisualEffectView *)insertBlurEffect;

/* 在固定位置插入高斯模糊 **/
- (UIVisualEffectView *)insertBlurEffectAtIndex:(NSInteger)index;

/* 在固定位置插入高斯模糊 **/
- (UIVisualEffectView *)insertBlurEffectAtIndex:(NSInteger)index effectStyle:(UIBlurEffectStyle)effectStyle;
- (UIVisualEffectView *)insertBlurEffectAtIndex:(NSInteger)index effectStyle:(UIBlurEffectStyle)effectStyle alpha:(CGFloat)alpha;

- (CGRect)relativePositionTo:(UIView *)aSuperView;
@end
